<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>同步刷新效果</title>
    <script type="text/javascript">
        //创建ajax对象
        var xhr = new XMLHttpRequest();

        //获取服务器响应信息并弹出
        xhr.onreadystatechange = function(){
            if(xhr.readyState == 4){
                alert(xhr.responseText);
            }
        }

        //请求服务器
        xhr.open('get','./12ServerFor11.php',true); //异步请求
        //传递需要进行查询的信息
        xhr.send(null);
    </script>
</head>
<body>
    <img src="./img/WP-AJAX.jpg" alt="" width="500px" height="300px">
</body>
</html>